<template>
	<view>
		<setupList :version="version" />
		<button class="btn" @tap="logou">退出登录</button>
	</view>
</template>
<script>
	import setUpList from '@/components/setupList/setupList.vue'

	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				version: ''
			}
		},
		onLoad() {
			this.version = this.$version
			if (this.hasLogin == true) {
				this.uIfo = this.userInfo
			}

		},
		computed: {
			...mapState(['hasLogin']),
		},
		methods: {
			...mapMutations(['logout']),
			logou() {
				this.logout()
				uni.showToast({
					title: '退出成功',
					icon: 'none'
				})
				uni.setStorageSync('token', '')
				setTimeout(() => {
					uni.switchTab({
						url: '/pages/index/index'
					})
				}, 1000)
			}
		}
	}
</script>

<style>
	.btn {
		color: white;
		background-color: #e80909;
		border-radius: 50rpx;
		margin: 100rpx 20rpx;
		font-size: 32upx;
		letter-spacing: 2upx;
	}

	page {
		background-color: #f0efee;
	}
</style>
